//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2003 Intrinsyc Europe Ltd.
//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004 Siemens AG
//
// Version: 1.1.2.5
// Date:    11. Jan. 2006
//////////////////////////////////////////////////////////////////////////////

#define FILE_DEVICE_MPX     2070
#define FILE_FUNCTION_MPX   2048

#define IOCTL_MPX_ENABLE_MPX         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  0, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_DISABLE_MPX        CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  1, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_ESTABLISH_DLC      CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  2, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_RELEASE_DLC        CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  3, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_SET_DLCI           CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  4, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_RESTART            CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  5, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_POWER_CTRL         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  7, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_POWER_LOSS         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  8, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_GET_VERSION        CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX +  9, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_RESET_PORT         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 10, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_CLOSE_PARENTPORT   CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 11, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_OPEN_PARENTPORT    CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 12, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_ADD_VIRTPORT       CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 13, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_REMOVE_VIRTPORT    CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 14, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_SEND_ESC_FRAME     CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 15, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_CLR_HW_RTS         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 16, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_MPX_SET_HW_RTS         CTL_CODE(FILE_DEVICE_MPX, FILE_FUNCTION_MPX + 17, METHOD_NEITHER, FILE_ANY_ACCESS)

#define IS_MPX_IOCTL(ioctl)          ((ioctl >= IOCTL_MPX_ENABLE_MPX) && (ioctl <= IOCTL_MPX_SET_HW_RTS))

//////////////////////////////////////////////////////////////////////////////

#define FILE_DEVICE_SIEMENS_MPX       2071
#define IOCTL_SIEMENS_MPX_POWER_FAIL  CTL_CODE(FILE_DEVICE_SIEMENS_MPX, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)

